# import basic pygame modules
import pygame
from pygame.locals import *

# class to check frames per second
class Check_FPS(pygame.sprite.Sprite):
    "this draws the frames per second, supply fps"
    def __init__(self):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.font = pygame.font.Font(None, 20)
        self.color = Color('white')
        self.fps = 0
        self.text = "FPS: %i" % self.fps
        self.image = self.font.render(self.text, 1, self.color)
        self.rect = self.image.get_rect().move(5, 5)

    def set_fps(self, get_fps):
        self.fps = get_fps

    def update(self):
        self.text = "FPS: %i" % self.fps
        self.image = self.font.render(self.text, 1, self.color)
        self.rect = self.image.get_rect().move(5, 5)
